/*
 * @Author: 赛罗
 * @Date: 2023-10-26 15:41:03
 * @LastEditors: 赛罗
 * @LastEditTime: 2024-05-08 10:22:23
 * @FilePath: \haixiaoke-enterprise-web-v5\src\api\house\rule.js
 * @Description:
 */
import request from "@/utils/request";

// 查询退订规则列表
export function listUnsubscribeRule(query) {
  return request({
    url: "/enterprise/apartment/unsubscribeRule/page",
    method: "get",
    params: query,
  });
}
// 新增退订规则
export function addUnsubscribeRule(data) {
  return request({
    url: "/enterprise/apartment/unsubscribeRule",
    method: "post",
    data: data,
  });
}
// 删除退订规则(路径传退订id)
export function delUnsubscribeRule(id) {
  return request({
    url: "/enterprise/apartment/unsubscribeRule/" + id,
    method: "delete",
  });
}

//修改退订规则的状态
export function changeUnsubscribeRuleStatus(unsubscribeRuleId, enableStatus) {
  const data = {
    unsubscribeRuleId
  };
  return request({
    url: "/enterprise/apartment/unsubscribeRule/edit/state",
    method: "put",
    data: data,
  });
}

//修改退订规则
export function updateUnsubscribeRule(data) {
  return request({
    url: "/enterprise/apartment/unsubscribeRule",
    method: "put",
    data: data,
  });
}

// 获取退订规则详细信息(路径传退订id)
export function getUnsubscribeRule(id) {
  return request({
    url: "/enterprise/apartment/unsubscribeRule/" + id,
    method: "get",
  });
}
